function data(term)

%function bjk
linearpartofbjk = [1,1,2,3;2,1,1,3;3,1,3,3;2,1,2,20];
constpartofbjk  = [1,0,0,0; 0,2,0, 0;0,3,0,0; 0, 4,0,0];

%function hjk
constpartofhjk  = [1,1,1,1; 1,2,2, 1;2,1,1,2; 2, 1,2,3];

%exact solution
uex{1} = @(x) sin(x);
uex{2} = @(x) exp(-x);
uex{3} = @(x) cos(x);
uex{4} = @(x) exp(x);

uexprime{1} = @(x)  cos(x);
uexprime{2} = @(x) -exp(-x);
uexprime{3} = @(x) -sin(x);
uexprime{4} = @(x)  exp(x);

uex2prime{1} = @(x) -sin(x);
uex2prime{2} = @(x) exp(-x);
uex2prime{3} = @(x) -cos(x);
uex2prime{4} = @(x)  exp(x);

%source function
switch term
    case 1
f{1} = @(x) -sin(x) .*(linearpartofbjk(1,1)*x+constpartofbjk(1,1))...
            +cos(x) .* constpartofhjk(1,1);
    case 2
f{1} = @(x) -sin(x) .*(linearpartofbjk(1,1)*x+constpartofbjk(1,1))...
            +exp(-x).*(linearpartofbjk(1,2)*x+constpartofbjk(1,2))...
            +cos(x) .* constpartofhjk(1,1)...
            -exp(-x).* constpartofhjk(1,2);
f{2} = @(x) -sin(x) .*(linearpartofbjk(2,1)*x+constpartofbjk(2,1))...
            +exp(-x).*(linearpartofbjk(2,2)*x+constpartofbjk(2,2))...
            +cos(x) .* constpartofhjk(2,1)...
            -exp(-x).* constpartofhjk(2,2);
    case 3
f{1} = @(x) -sin(x) .*(linearpartofbjk(1,1)*x+constpartofbjk(1,1))...
            +exp(-x).*(linearpartofbjk(1,2)*x+constpartofbjk(1,2))...
            -cos(x) .*(linearpartofbjk(1,3)*x+constpartofbjk(1,3))...
            +cos(x) .* constpartofhjk(1,1)...
            -exp(-x).* constpartofhjk(1,2)...
            -sin(x) .* constpartofhjk(1,3);
f{2} = @(x) -sin(x) .*(linearpartofbjk(2,1)*x+constpartofbjk(2,1))...
            +exp(-x).*(linearpartofbjk(2,2)*x+constpartofbjk(2,2))...
            -cos(x) .*(linearpartofbjk(2,3)*x+constpartofbjk(2,3))...
            +cos(x) .* constpartofhjk(2,1)...
            -exp(-x).* constpartofhjk(2,2)...
            -sin(x) .* constpartofhjk(2,3);
f{3} = @(x) -sin(x) .*(linearpartofbjk(3,1)*x+constpartofbjk(3,1))...
            +exp(-x).*(linearpartofbjk(3,2)*x+constpartofbjk(3,2))...
            -cos(x) .*(linearpartofbjk(3,3)*x+constpartofbjk(3,3))...
            +cos(x) .* constpartofhjk(3,1)...
            -exp(-x).* constpartofhjk(3,2)...
            -sin(x) .* constpartofhjk(3,3);
    case 4
f{1} = @(x) -sin(x) .*(linearpartofbjk(1,1)*x+constpartofbjk(1,1))...
            +exp(-x).*(linearpartofbjk(1,2)*x+constpartofbjk(1,2))...
            -cos(x) .*(linearpartofbjk(1,3)*x+constpartofbjk(1,3))...
            +exp(x) .*(linearpartofbjk(1,4)*x+constpartofbjk(1,4))...
            +cos(x) .* constpartofhjk(1,1)...
            -exp(-x).* constpartofhjk(1,2)...
            -sin(x) .* constpartofhjk(1,3)...
            +exp(x) .* constpartofhjk(1,4);
f{2} = @(x) -sin(x) .*(linearpartofbjk(2,1)*x+constpartofbjk(2,1))...
            +exp(-x).*(linearpartofbjk(2,2)*x+constpartofbjk(2,2))...
            -cos(x) .*(linearpartofbjk(2,3)*x+constpartofbjk(2,3))...
            +exp(x) .*(linearpartofbjk(2,4)*x+constpartofbjk(2,4))...
            +cos(x) .* constpartofhjk(2,1)...
            -exp(-x).* constpartofhjk(2,2)...
            -sin(x) .* constpartofhjk(2,3)...
            +exp(x) .* constpartofhjk(2,4);
f{3} = @(x) -sin(x) .*(linearpartofbjk(3,1)*x+constpartofbjk(3,1))...
            +exp(-x).*(linearpartofbjk(3,2)*x+constpartofbjk(3,2))...
            -cos(x) .*(linearpartofbjk(3,3)*x+constpartofbjk(3,3))...
            +exp(x) .*(linearpartofbjk(3,4)*x+constpartofbjk(3,4))...
            +cos(x) .* constpartofhjk(3,1)...
            -exp(-x).* constpartofhjk(3,2)...
            -sin(x) .* constpartofhjk(3,3)...
            +exp(x) .* constpartofhjk(3,4);
f{4} = @(x) -sin(x) .*(linearpartofbjk(4,1)*x+constpartofbjk(4,1))...
            +exp(-x).*(linearpartofbjk(4,2)*x+constpartofbjk(4,2))...
            -cos(x) .*(linearpartofbjk(4,3)*x+constpartofbjk(4,3))...
            +exp(x) .*(linearpartofbjk(4,4)*x+constpartofbjk(4,4))...
            +cos(x) .* constpartofhjk(4,1)...
            -exp(-x).* constpartofhjk(4,2)...
            -sin(x) .* constpartofhjk(4,3)...
            +exp(x) .* constpartofhjk(4,4);
end
fname='data';
save(fname,'linearpartofbjk','constpartofbjk','constpartofhjk','uex','f')

